﻿<UserControl x:Class="Songhay.BiggestBox.Desktop.Modules.ODataWeather.Views.DataPointsView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d"
    xmlns:mah="http://metro.mahapps.com/winfx/xaml/controls"
    xmlns:rxSharedModels="clr-namespace:Songhay.BiggestBox.Portable.Shared.Models;assembly=Songhay.BiggestBox.Portable.Shared"
    xmlns:vc="clr-namespace:Songhay.ValueConverters;assembly=Songhay.Mvvm"
    d:DesignWidth="{x:Static rxSharedModels:AppScalars.ModuleWidth}" d:DesignHeight="{x:Static rxSharedModels:AppScalars.ModuleHeight}">
    <UserControl.Resources>
        <vc:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />
    </UserControl.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="10*" />
            <RowDefinition Height="90*" />
        </Grid.RowDefinitions>
        <TextBlock Style="{StaticResource H1Style}" Text="OData Weather" />
        <mah:ProgressRing Grid.Row="1" IsActive="{Binding IsDoingServiceOperation}" />
        <DataGrid Grid.Row="1" x:Name="DataPointsGrid"
            AutoGenerateColumns="False"
            ItemsSource="{Binding DataPoints}"
            Visibility="{Binding IsDoingServiceOperation, Converter={StaticResource BooleanToVisibilityConverter}, ConverterParameter='true'}">
            <DataGrid.Columns>
                <DataGridTextColumn Binding="{Binding DewPoint}" Header="Dew Point" />
                <DataGridTextColumn Binding="{Binding Humidity}" Header="Humidity" />
                <DataGridTextColumn Binding="{Binding Pressure}" Header="Pressure" />
                <DataGridTextColumn Binding="{Binding Rain}" Header="Rain" />
                <DataGridTextColumn Binding="{Binding Sun}" Header="Sun" />
                <DataGridTextColumn Binding="{Binding Temperature}" Header="Temperature" />
                <DataGridTextColumn Binding="{Binding TimePoint}" Header="Time Point" />
                <DataGridTextColumn Binding="{Binding WindDirection}" Header="Wind Direction" />
                <DataGridTextColumn Binding="{Binding WindSpeed}" Header="Wind Speed" />
                <DataGridTextColumn Binding="{Binding WindSpeedMax}" Header="Max Wind Speed" />
            </DataGrid.Columns>
        </DataGrid>
    </Grid>
</UserControl>
